package com.ifeng.py;
/**
 * 抓取网站http://xh.5156edu.com/pinyi.html所有汉字的拼音
 * */
public class PyIndex {
	public static void main(String[] args) {
		String[] aClass=new String[2];
		aClass[0]="fontbox";
		aClass[1]="fontbox";
		String path="C:\\py.txt";
		int dep=-1;
		if(args.length>0){
			path=args[0];
		}
		if(args.length>1){//主要是提供测试
			try {
				dep=Integer.valueOf(args[1]);
			} catch (Exception e) {
				dep=-1;
			}
		}
		try {
			int total=new PyService(path,dep).savePyToPath("http://xh.5156edu.com/","pinyi.html",0,aClass);
			System.out.println("总工收录汉字:"+total+"个");
		} catch (Exception e) {
			// TODO: handle exception
			System.out.println(e.toString());
		}
	}
}
